/*************************************************
 *FileName:      pm.js
 *Description:   代理人管理.js
 *Others:        陈灿
 *************************************************/
    /*
     * 启动
     */
    mui.init();
    mui('.mui-scroll-wrapper').scroll({
        indicators: false,      //是否显示滚动条 默认为true
        deceleration: 0.003,    //阻尼系数,系数越小滑动越灵敏 默认0.0006
        bounce: true,           //是否启用回弹 默认true
        longtap: true,          //默认为false
    });
    /*
     * 变量初始化
     */
    var uid = localStorage.replace_uid;
    var token = localStorage.replace_token
    /*
     * 主程序
     */ 
    $(document).ready(function() 
    {
        //数据加载
        lode();
    });
    /**
     * lode
     * 数据加载
     * @cc 
     * @DateTime 2018-01-08T06:19:16+0800
     * @param    int        
     * @return   void
     */
    function lode(){
        $.ajax({
            type: "post",
            url: DOMAIN_NAME + "/index.php/api/user/agentInfo",
            dataType:'jsonp',
            data: { uid: uid, token: token },
            success: function(data) {
                if(data.error_code == 0){
                    var ohtml='<li class="tab"><p>代理总收益：<span>'+data.data.income+' </span>换币</p>'
                                +'</li><li class="tab"><p>用户数：<span>'+data.data.user_lower+' </span>个</p></li>'
                                +'<li class="tab"><p>下级代理数：<span>'+data.data.agent_lower+' </span>个</p></li>'
                    $('.tab-box').html(ohtml)
                }else if(data.error_code == 1001){
                    setTimeout(function(){
                        exitlogin();
                    },1000);
                }else{
                    mui.alert(data.error_msg,'提示','确定',function(){
                        setTimeout(function(){
                            mui.back()
                        },350)
                    },'div')
                }
            }
        }); 
    }